#ifndef PAGECONTROLLER_H
#define PAGECONTROLLER_H

#include <QObject>
#include <chatpage.h>
#include "userinfopage.h"
#include "qqwindow.h"
#include "loginpage.h"
#include "addpage.h"
#include "friendmode.h"
#include "userchatmode.h"


class PageController : public QObject
{
    Q_OBJECT

public:
    static PageController* Getinstance(){
            return &instance;
    }
    void showChatPage(QWidget *parent = nullptr );
    void showChatPage(QWidget *parent, const QString &username,const QString &uid);
    void closeChatPage();
    void hideChatPage();
    void showQQWindow(QWidget *parent = nullptr);
    void hideQQWindow();
    void closeQQWindow();
    void showLoginPage();
    void closeLoginPage();
    void showAddPage();
    void closeAddPage();
private:
    static PageController instance;
    ChatPage *chatPage = nullptr;
    UserInfoPage *userInfoPage = nullptr;
    QQWindow *qqwindow = nullptr;
    LoginPage *loginPage = nullptr;
    AddPage *addPage = nullptr;
    PageController();


};

#endif // PAGECONTROLLER_H
